//
//  KKTimer.h
//  PhnixHome
//
//  Created by Levy Xu on 2017/12/20.
//  Copyright © 2017年 Levy Xu. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface KKTimer : NSObject

@property (nonatomic, assign) NSTimeInterval interval;
@property (readonly, getter=isValid) BOOL valid;

+(KKTimer *)once:(NSTimeInterval)interval task:(void (^)(NSUInteger times))task;

+(KKTimer *)every:(NSTimeInterval)interval task:(void (^)(NSUInteger times))task;

+(KKTimer *)every:(NSTimeInterval)interval repeat:(NSUInteger)repeat task:(void (^)(NSUInteger times))task;


-(void)fire;

-(void)invalidate;

@end
